Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse as float and then round to int #356

Closed
wants to merge 2 commits into from

Conversation

daveisfera
Copy link
Contributor

Fixes #355

@@ -959,7 +959,10 @@ def __init__(self, uri, stream_info, media, base_uri):
if resolution is not None:
resolution = resolution.strip('"')
values = resolution.split("x")
resolution_pair = (int(values[0]), int(values[1]))
resolution_pair = (
int(round(float(values[0]))),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just out of curiosity: is there any packager outputting manifests with decimal resolution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some example files I was testing with that had 1280.0x720.0 but I'm not sure where they came from. ffmpeg outputs them as integers and I assume that most do as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries, thank you

@leandromoreira
Copy link
Contributor

leandromoreira commented Feb 7, 2024

H264 uses integers to represent resolution. pic_width_in_mbs_minus_1 ue(v)
image

I think we should avoid adding unnecessary changes.

@daveisfera
Copy link
Contributor Author

Closing since this is out of spec

@daveisfera daveisfera closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RESOLUTION as float raises exception
2 participants